import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import {resolve} from "path"
import legacy from '@vitejs/plugin-legacy'
function pathResolve(dir) {
  return resolve(process.cwd(), ".", dir);
}
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    legacy({
      targets: ['defaults', 'not IE 11']
    }),
  ],
  define:{
    'process.env':{}
  },
  resolve: {
    alias: [
      {
        find: /@\//,
        replacement: `${pathResolve("src")}/`,
      },
    ],
  },
  server:{
    host:'localhost',
    proxy:{
      '/services/admin': {
        target:'http://10.110.200.54:7071/',
        changeOrigin: true
      },
    }
  }
})
